home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part1 / 7350 < prev    next >
Encoding:
Text File  |  1996-08-05  |  1.4 KB  |  32 lines

  1. Path: newsfeed.direct.ca!usenet
  2. From: etoivane@direct.ca (Ed Toivanen)
  3. Newsgroups: comp.lang.c
  4. Subject: Re: File Based linked list
  5. Date: 25 Feb 1996 21:12:30 GMT
  6. Organization: Your Organization
  7. Message-ID: <4gqjbu$jno@aphex.direct.ca>
  8. References: <Pine.SOL.3.90.960219171637.21117B-100000@eddie>
  9. NNTP-Posting-Host: 204.174.243.150
  10. Mime-Version: 1.0
  11. Content-Type: Text/Plain; charset=US-ASCII
  12. X-Newsreader: WinVN 0.99.6
  13.  
  14.  
  15. >        Anyone know how to write a file based linked list... How 
  16. >different is it to implement then a regular memory based linked list?? 
  17. >Any source code would be greatly appriciated... BTW I am a student and I 
  18. >need it for an assignment...
  19.  
  20. Sound like we have the same assignment!  We just had an assignment at BCIT 
  21. where we stored an array of indexes of structures to a file. The fields of the 
  22. struct were the name, and file position of the record in the data file.  The 
  23. new assignment is to convert to linked lists.  The data file will naturally 
  24. remain unchanged, but the index file will run this way: Create a new element, 
  25. copy the next struct (i*structSize) into the linked list from the index file, 
  26. repeat if necessary!  At the end of execution, rewrite the index file with the 
  27. updated index, one struct at a time.  BTW do all the i/o in binary mode, as 
  28. life will be much simpler.  I'll post the necessary code, once it's written.  
  29.  
  30. C ya later, Ed
  31.  
  32.